###### RDF Maps #######

# Load Packages
install.packages(c("usmap","ggplot2"))

library(usmap)
library(ggplot2)


#Set working directory
setwd("Replication Files")

#Withdrawal and deposit rule map
RDF_rules <- read.csv("RDF_rules.csv")

colnames(RDF_rules) <- c("region","state","Deposit Mechanism","Withdrawal Mechanism")
  

# Plot RDF deposit rules
plot_usmap(
  data = RDF_rules, values = "Deposit Mechanism", linewidth = .15) + 
  scale_fill_discrete() + 
  scale_fill_brewer(palette = "Blues") +
  labs() +
  theme(legend.position = "right")

# Plot RDF withdrawal rules
plot_usmap(
  data = RDF_rules, values = "Withdrawal Mechanism", linewidth = .15) + 
  scale_fill_discrete() + 
  scale_fill_brewer(palette = "Blues") +
  labs() +
  theme(legend.position = "right")








